package com.zhiwei.jenkins.common.basics;

import com.zhiwei.jenkins.common.enums.ResponseCode;

import java.util.List;

/**
 * @Description: java类作用描述
 * @Author: wyjun
 * @UpdateDate: 2019/11/14 10:03
 * @Version: 1.0
 */
public class BaseErrorResponse extends BaseResponse {

    public BaseErrorResponse() {
        super(ResponseCode.REQUESTERROR.getHttpCode(), ResponseCode.REQUESTERROR.getMsg());
        this.errorCode = ResponseCode.REQUESTERROR.getErrorCode();
    }
    public BaseErrorResponse(String errorMsg) {
        super(ResponseCode.REQUESTERROR.getHttpCode(), errorMsg);
        this.errorCode = ResponseCode.REQUESTERROR.getErrorCode();
    }

    private String errorCode;

    protected ParamErrorDetail paramErrorDetail;

    protected List<ParamErrorDetail> paramErrorDetails;

    public BaseErrorResponse(int code, String errorCode, String msg) {
        super(code, msg);
        this.errorCode = errorCode;
    }

    public BaseErrorResponse(List<ParamErrorDetail> paramErrorDetails) {
        super(ResponseCode.PARAM_ERROR.getHttpCode(), ResponseCode.PARAM_ERROR.getMsg());
        this.errorCode = ResponseCode.PARAM_ERROR.getErrorCode();
        this.paramErrorDetails = paramErrorDetails;
    }

    public BaseErrorResponse(ParamErrorDetail paramErrorDetail) {
        super(ResponseCode.PARAM_ERROR.getHttpCode(), ResponseCode.PARAM_ERROR.getMsg());
        this.errorCode = ResponseCode.PARAM_ERROR.getErrorCode();
        this.paramErrorDetail = paramErrorDetail;
    }

    public String getErrorCode() {
        return errorCode;
    }
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public ParamErrorDetail getParamErrorDetail() {
        return paramErrorDetail;
    }

    public void setParamErrorDetail(ParamErrorDetail paramErrorDetail) {
        this.paramErrorDetail = paramErrorDetail;
    }

    public List<ParamErrorDetail> getParamErrorDetails() {
        return paramErrorDetails;
    }

    public void setParamErrorDetails(List<ParamErrorDetail> paramErrorDetails) {
        this.paramErrorDetails = paramErrorDetails;
    }
}
